<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,minimum-scale=1, user-scalable=no">
		<title>解构赋值</title>
		<script type="text/javascript">
			//数组的解构赋值
			//1、获得元素
			let [a,b,c] = [1,2,3]
			//1 2 3
			console.log(a,b,c)
			//2、获得元素数组
			let [num, ...list] = ['a', 'b', 'c', 'd']
			//a
			console.log(num)
			//["b", "c", "d"]
			console.log(list)
			
			//3、把数组合并
			let arr = [1,2,3]
			let li = ['a', 'b', 'c',...arr]
			//["a", "b", "c", 1, 2, 3]
			console.log(li)
		</script>
	</head>
	<body>
		<div id="app">
			<!-- todo -->
		</div>
	</body>
</html>
